package com.micro.ai.auth.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 手机号登录请求DTO
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@Schema(description = "手机号登录请求")
public class PhoneLoginRequest implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "租户ID（可选，默认使用第一个租户）", example = "1001", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String tenantId;

    @Schema(description = "手机号（必填）", example = "13800138000", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "短信验证码（必填）", example = "123456", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "验证码不能为空")
    @Pattern(regexp = "^\\d{6}$", message = "验证码必须是6位数字")
    private String smsCode;

    @Schema(description = "记住我（可选，默认false）", example = "true")
    private Boolean rememberMe;

    @Schema(description = "设备ID（可选）", example = "device_12345")
    private String deviceId;

    @Schema(description = "设备名称（可选）", example = "iPhone 13")
    private String deviceName;
}
